Fixing time parameter support for some gates#20
Open
diogovalada wants to merge 3 commits intoquantumsim:masterfrom
Open
Fixing time parameter support for some gates#20diogovalada wants to merge 3 commits intoquantumsim:masterfrom
diogovalada wants to merge 3 commits intoquantumsim:masterfrom
Conversation
Modified the conditions which check len(gate_desc) in order to support gate_desc with 'time' and or 'return_flag'
Added the extra time parameter in the (X_gate, Y_gate, Z_gate, had_from_rot, CNOT_from_CZ, CRX_from_CZ) functions during the 'builder < ' call, so that the these gates are created with the correct time tag. (circuit_builder.__lt__ was modified in the previous commit to allow for this.
This was referenced Nov 24, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As a result of finding a bug in #19 where some gates would disregard the
timeargument during theb.add_gate, I made some changes to the code:In
qsoverlay/gate_functions.py, the functionsX_gate,Y_gate,Z_gate,had_from_rot,CNOT_from_CZ,CRX_from_CZfailed to use the time parameter in a meaningful manner. I added the parameter to the tuple passed tocircuit_builder.__lt__.In
qsoverlay/circuit_builder.py, inBuilder.__lt__, I modified the conditions which verified thelen(gate_desc), in order to make them support the usage of thetimeAND/ORreturn_flag. It however assumes that, if both flags are used,timeshould precedereturn_flags.These changes should fix the bugs during the construction of
circuit_buildercircuits via theadd_gatemethod. It is still necessary to add time support to other places whereBuilder.__lt__is called. In the meantime, the changes I made shouldn't cause any conflict with those, however.Regards,
Diogo Valada